//
//  TestUIViewController.m
//  xiaoTest
//
//  Created by xiao_shoubao on 16/9/26.
//  Copyright © 2016年 xiao_shoubao. All rights reserved.
//

#import "TestUIViewController.h"

@interface TestUIViewController ()

@end

@implementation TestUIViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.navigationItem.title = @"测试";
    CGFloat width = [UIScreen mainScreen].bounds.size.width;
    CGFloat height = [UIScreen mainScreen].bounds.size.height;
    
    //初始化一个UIButton 连式语法 测试
    UIButton * btnChain = [UIButton initialization]().rect(CGRectMake((width-100)/2, height/2, 100, 40))
    .normalTitle(@"normal")
    .bgColor([UIColor blackColor])
    .action(self, @selector(changeSelected:));
    
    [self.view addSubview:btnChain];
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}




-(void)changeSelected:(UIButton *)sender {
    sender.selected = !sender.selected;
    if (!sender.selected) {
        sender.normalTitle(@"normal").bgColor([UIColor blackColor]);
    }
    else {
        sender.selectTitle(@"selected").bgColor([UIColor purpleColor]);
    }
}

- (IBAction)but1:(id)sender {
    


}



/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
